<?php
namespace app\common\validate;
use think\Validate;
class Bis extends Validate {
    protected $rule = [
        ['id','number'],
        ['bis_id','number'],
        ['name','require|max:50','商户名称必须填写|商户名称不能超过50个字符'],
        ['email','require|email','邮箱必须填写|邮箱格式不正确'],
        ['logo','require','请上传缩略图'],
        ['licence_logo','require','请上传营业执照'],
        ['city_id','require','请选择所属城市'],
        ['bank_info','require','银行账号必须填写'],
        ['bank_name','require','开户行名称填写'],
        ['bank_user','require','开户人姓名必须填写'],
        ['faren','require','法人必须填写'],
        ['faren_tel','require','法人电话必须填写'],
        ['status','number|in:-1,0,1,2','状态必须是数字|状态范围不合法'],
    ];

    // 场景设置
    protected  $scene = [
        'add' => ['name', 'email', 'logo','licence_logo','description', 'city_id', 'bank_info', 'bank_name', 'bank_user', 'faren', 'faren_tel'],
        'status' =>['id','status'],
    ];
}